package com.vgemv.jsutilitysdk.JsButtonTwo;

import android.graphics.Rect;

public class JsButtonTwoVm {

    public boolean mb_isSelected;
    public JsButtonSingleStateVm mssvm_unselected;
    public JsButtonSingleStateVm mssvm_selected;

    public JsButtonTwoVm() {
        mssvm_unselected = new JsButtonSingleStateVm();
        mssvm_selected = new JsButtonSingleStateVm();
        mb_isSelected = false;
    }

    public JsButtonSingleStateVm curentSsvm() {
        if(mb_isSelected) {
            return mssvm_selected;
        }
        else {
            return mssvm_unselected;
        }
    }

    public void setTextSize(int textSize) {
        mssvm_selected.mi_textSize = textSize;
        mssvm_unselected.mi_textSize = textSize;
    }

    public void setText(String text) {
        mssvm_selected.text = text;
        mssvm_unselected.text = text;
    }

    public void setBackgroundColor(int color) {
        mssvm_unselected.mI_backgroundColor = color;
        mssvm_selected.mI_backgroundColor = color;
    }

    public void setSize(int width,int height) {
        mssvm_selected.mi_width = width;
        mssvm_selected.mi_height = height;
        mssvm_unselected.mi_width = width;
        mssvm_unselected.mi_height = height;
    }

    public void setImage(int unselectedImageId,int selectedImageId) {
        mssvm_unselected.mI_imageId = unselectedImageId;
        mssvm_selected.mI_imageId = selectedImageId;
    }
    
    public void setImageFrame(Rect rect) {
        mssvm_unselected.imageFrame = rect;
        mssvm_selected.imageFrame = rect;
    }
    public void setTextFrame(Rect rect) {
        mssvm_unselected.textFrame = rect;
        mssvm_selected.textFrame = rect;
    }


    public void setBorder(int borderWidth) {
        setBorder(borderWidth,null,null);
    }

    public void setBorder(int borderWidth,Integer borderColor,Integer cornerRadius) {
        mssvm_unselected.mI_borderWidth = borderWidth;
        mssvm_unselected.mI_backgroundColor = borderColor;
        mssvm_unselected.mI_cornerRadius = cornerRadius;
        mssvm_selected.mI_backgroundColor = borderColor;
        mssvm_selected.mI_cornerRadius = cornerRadius;
        mssvm_selected.mI_borderWidth = borderWidth;
    }
}
